package main

import (
	"fmt"
	"log"
	"net"
	"time"
)

func socketClient(){
	conn, err := net.Dial("tcp", ":18080")
	if err!=nil {
		log.Fatalln("connect error")
	}

	defer conn.Close()
	conn.Write([]byte( fmt.Sprintf("hello %d", time.Now().Unix()) ))

	buff := make([]byte, 2014)
	n, _ := conn.Read(buff)
	log.Println("Receive: %s", buff[:n])
}

func main() {
	socketClient()
}